import { set } from 'lodash-es';
import { defineStore } from 'pinia';

import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

export const useVolunteerStore = defineStore('volunteer', {
  state: () => ({
    provinces: [],
    isSmartRecommend: false,
    defaultBatchType: '11',
    defaultCateType: '30', //有些接口还是需要这个参数
    batchTypeList: [],
    volunteerInfo: {},
    firstStepData: {},
    secondStepData: [],
    thirdStepData: {},
  }),
  actions: {
    setProvinces(provinces) {
      this.provinces = provinces;
    },
    setIsSmartRecommend(isSmartRecommend) {
      this.isSmartRecommend = isSmartRecommend;
    },
    setDefaultBatchType(batchType) {
      this.defaultBatchType = batchType;
    },
    setDefaultCateType(cateType) {
      this.defaultCateType = cateType;
    },
    setBatchTypeList(batchTypeList) {
      this.batchTypeList = batchTypeList;
    },
    setVolunteerInfo(volunteerInfo) {
      this.volunteerInfo = volunteerInfo;
    },
    setFirstStepData(firstStepData) {
      this.firstStepData = firstStepData;
    },
    setSecondStepData(secondStepData) {
      this.secondStepData = secondStepData;
    },
    setThirdStepData(thirdStepData) {
      this.thirdStepData = thirdStepData;
    },
  },
  persist: true,
});
